﻿using System.Collections.Generic;
using NanoERP.Model.Poco;

namespace NanoERP.Model.SystemMgmt
{
    public class RoleTree : SYS_RoleType
    {
        private IList<RoleTree> _children;
        private IList<RoleModel> _roles;

        public IList<RoleTree> Children
        {
            get
            {
                if (_children == null)
                    _children = new List<RoleTree>();
                return _children;
            }
        }

        public IList<RoleModel> Roles
        {

            get
            {
                if (_roles == null)
                    _roles = new List<RoleModel>();
                return _roles;
            }
        }

        public override string ToString()
        {
            return string.Format("{0},C:{1},R:{2}", this.Name, this.Children.Count, this.Roles.Count);
        }

    }
}
